import type { ExtIdTuple, VARCHAR255_PG } from "~/db.pg";
import type { ExtIntro, ExtSkuTpl } from "~/extend";

import type { ExtOwner } from "@/stream-user/core.define";

import { Stockable } from "@/river-stock/core.define";

/** 商品模板分组 */
export type TonTplGroup = ExtIdTuple &
  ExtOwner &
  ExtIntro & {
    /** 公式名称 */
    formulaName: VARCHAR255_PG;
    /** 公式内容 */
    formulaContent: VARCHAR255_PG;

    joinTonTplList?: TonTpl[];
  };

/** 商品模板 */
export type TonTpl = ExtIdTuple &
  ExtOwner &
  ExtSkuTpl &
  Stockable & {
    refTonTplGroupId: TonTplGroup["id"];
    justTonTplGroup?: TonTplGroup;
  };
